<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>child</title>
</head>
<body>
<button onclick="success()" >
    操作成功了
</button >
<script>
    function success(){
        param({code:success})
    }
</script>
<script type="text/javascript">
    var proxyMain;
    function param (data){
        var otherValue = JSON.stringify(data);
        //首先建立代理
        if(proxyMain){
            proxyMain.src = 'http://localhost/proxy.html?data='+otherValue;
        }else{
            proxyMain = document.createElement('iframe');
            proxyMain.name = 'proxyMain';
            proxyMain.style.display = 'none';
            document.body.appendChild(proxyMain);
            //传值
            proxyMain.src = 'http://localhost/proxy.html?data='+otherValue;
        }
    }

</script>
</body>
</html>
